package com.ruyuan.eshop.order.elasticsearch.handler;

import com.ruyuan.eshop.order.elasticsearch.query.AfterSaleListQueryIndex;
import com.ruyuan.eshop.order.elasticsearch.query.OrderListQueryIndex;

import java.util.List;

/**
 * es抽象handler
 * 儒猿课堂: http://www.ruyuan2020.com
 * @Author zhonghuashishan
 * @Remark 有问题直接联系客服VX: ruyuan-1111 ，源码-笔记-技术交流群
 * @Version 1.0
 **/
public abstract class EsAbstractHandler {

    public void setEsIdOfOrderListQueryIndex(List<OrderListQueryIndex> list) {
        list.forEach(e -> e.setEsId(e.getOrderItemId() + "_" + e.getPayType()));
    }

    public void setEsIdOfAfterSaleListQueryIndex(List<AfterSaleListQueryIndex> list) {
        list.forEach(e -> e.setEsId(e.getAfterSaleId() + "_" + e.getSkuCode()));
    }

}
